home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 701 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. From: "Paul D. DeRocco" <pderocco@ix.netcom.com>
  2. Message-ID: <31470097.36C0@ix.netcom.com>
  3. X-Original-Date: Wed, 13 Mar 1996 12:06:31 -0500
  4. Path: in2.uu.net!bounce-back
  5. Date: 13 Mar 96 23:43:59 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: no operator bool()?
  9. Organization: Netcom
  10. References: <313ddfd9.16044605@sqarc.sq.com> <313E19BB.5AE2E407@cantrip.org> <31445809.5921189@news.ultranet.com>
  11. X-Netcom-Date: Wed Mar 13  9:07:41 AM PST 1996
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMUddzuEDnX0m9pzZAQEoAgF/RB36DSdEu1H05QIVUrXGSa6uGSxqUxew
  15.     5JlNPsohK0EJtHMSPWTbOsES3a/k5L6N
  16.     =meXE
  17.  
  18. Pablo Halpern wrote:
  19. > I really don't see why the committee is so
  20. > resistant to this concept. I think the following would be a perfectly
  21. > satisfactory usage:
  22. >    class istream : public ...
  23. >    {
  24. >      ...
  25. >      explicit operator bool() const;
  26. >      ...
  27. >    };
  28. >    void f()
  29. >    {
  30. >      while (bool(cin))
  31. >        // do something
  32. >    }
  33.  
  34. There's an awful lot of code out there that says "while (cin) ...", and 
  35. no one wants to rewrite it all just to coax it through the new compiler. 
  36. That's probably the reason.
  37.  
  38. -- 
  39.  
  40. Ciao,
  41. Paul D. DeRocco
  42. ---
  43. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  44. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  45. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  46. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  47. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  48.